package special;

import java.util.ArrayDeque;
import java.util.Queue;

class MyStack {
    ArrayDeque<Integer> queue = new ArrayDeque<>();
    public MyStack() {

    }
    
    public void push(int x) {
        queue.addLast(x);
    }
    
    public int pop() {
        return queue.pollLast();
    }
    
    public int top() {
        return queue.peekLast();
    }
    
    public boolean empty() {
        return queue.isEmpty();
    }
}